package com.huodongrili.calender.bg;

import com.huodongrili.calender.BuildConfig;
import com.huodongrili.calender.data.Constant;
import com.huodongrili.calender.util.ECLog;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class SettingChangedReceiver extends BroadcastReceiver {

	private HandleSettingListener mListener;
	
	public SettingChangedReceiver(HandleSettingListener lis){
		mListener = lis;
	}
	
	@Override
	public void onReceive(Context arg0, Intent intent) {
		
		String action = intent.getAction();
		
		if(BuildConfig.DEBUG){
			ECLog.debug("the SettingChangedReceiver action:"+ action);
		}
		
		
		if(action.equals(Constant.ACTION_SETTING_LOCAL_CHANGED)){
			mListener.HandleLocalChanged();
		}else if(action.equals(Constant.ACTION_WEATHER_REFRESH)){
			mListener.HandleWeatherChanged(intent);
		}
	}

}
